package com.itzmn.thread.synchronizedtest;

/**
 * @Author: 张梦楠
 * @Date: 2018/12/27 14:52
 * 简书：https://www.jianshu.com/u/d611be10d1a6
 * 码云：https://gitee.com/zhangqiye
 * @Description:
 */
public class ThreadT extends Thread {

    private Father father;
    private boolean eat = true;

    ThreadT(Father father,boolean eat){
        this.father = father;
        this.eat = eat;
    }

    @Override
    public void run() {
        if (eat){
            father.eat();
        }else {
            father.say();
        }
    }
}
